package com.nameless.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author chh
 * @since 2023-02-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_order")
@ApiModel(value="Order对象", description="")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "客户ID")
    private Integer clientId;

    @ApiModelProperty(value = "车辆ID")
    private Integer carId;

    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "租出门店")
    private Integer brrowShop;

    @ApiModelProperty(value = "归还门店")
    private Integer returnShop;

    @ApiModelProperty(value = "总金额")
    private Double totalPrice;

    @ApiModelProperty(value = "预付金额")
    private Double preparidAmount;

    @ApiModelProperty(value = "订单状态（输入Entered1，提交Booked2，预约Reserved3，使用中Inuse4，交还Returned5，取消Cancelled6）")
    private Integer state;

    @ApiModelProperty(value = "是否送车上门")
    @TableField("IsGetCarAtHome")
    private String IsGetCarAtHome;

    @ApiModelProperty(value = "上门地址ID")
    @TableField("GetCarLocation")
    private String GetCarLocation;

    @ApiModelProperty(value = "是否上门还车")
    @TableField("IsReturnCarAtHome")
    private String IsReturnCarAtHome;

    @ApiModelProperty(value = "上门地址ID")
    @TableField("ReturnCarLocation")
    private String ReturnCarLocation;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime addtime;

    @TableField("orderNo")
    private String orderNo;

    @TableField(exist = false)
    private String clientName;

    @TableField(exist = false)
    private String cartName;

    @TableField(exist = false)
    private String shopName;

    @TableField(exist = false)
    private String returnName;

    @TableField(exist = false)
    private Car car;
}
